﻿using System;
using System.Collections.Generic;
using Headspring.Training.Core.Model;
using NUnit.Framework;
using NUnit.Framework.SyntaxHelpers;

namespace Headspring.Training.UnitTests.Model
{
	[TestFixture]
	public class SecretaryTester
	{
		[Test]
		public void ShouldHaveAddedEmailPreference()
		{
			var secretary = new Secretary();
			secretary.AddEmailPreference(DayOfWeek.Sunday, "foo@test.com");
			secretary.AddEmailPreference(DayOfWeek.Wednesday, "bob@test.com");

			IDictionary<DayOfWeek, string> emailPrefs = secretary.GetEmailPreferences();
			Assert.That(emailPrefs[DayOfWeek.Sunday], Is.EqualTo("foo@test.com"));
			Assert.That(emailPrefs[DayOfWeek.Wednesday], Is.EqualTo("bob@test.com"));
		}

		[Test]
		public void ShouldReturnCorrectEmailWhenCallingGetRejectAddress()
		{
			var secretary = new Secretary("lee", "lee", "brandt", "e@mail.com");
			secretary.AddEmailPreference(DayOfWeek.Sunday, "foo@test.com");

			Assert.AreEqual("e@mail.com", secretary.GetRejectEmail(DayOfWeek.Monday));
			Assert.AreEqual("foo@test.com", secretary.GetRejectEmail(DayOfWeek.Sunday));
		}
	}
}